package com.yincheng.oes.business.franchisee;

import java.util.List;

import org.apache.commons.lang3.tuple.Pair;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yincheng.oes.business.util.Page;
import com.yincheng.oes.sso.util.UserUtils;

@Service
public class FranchiseeListService {
    @Autowired
    private FranchiseeListMapper franchiseeListMapper;

    public Pair<Integer, List<QueryResultRow>> getPaperListByParam(QueryParamBean param) {
        String userId = UserUtils.getUser().getUserId();
        param.setUserId(userId);
        Integer total = franchiseeListMapper.countByQueryParam(param);
        Page page = param.getPage();
        page.setTotal(total);
        List<QueryResultRow> list = franchiseeListMapper.selectByQueryParam(param);
        return Pair.of(total, list);
    }
}
